From 2b7f80a8a0f0e4787674631c28ab95b188367aa9 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 28 Aug 2017 08:03:42 -0700 Subject: [PATCH] Fix tests on nightly --- tests/build-auth.rs | 4 ++-- tests/concurrent.rs | 1 - tests/cross-compile.rs | 15 +++++++++++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/tests/build-auth.rs b/tests/build-auth.rs index 7feddac4a..ef1484820 100644 --- a/tests/build-auth.rs +++ b/tests/build-auth.rs @@ -34,9 +34,9 @@ fn http_auth_offered() { let mut conn = BufStream::new(server.accept().unwrap().0); let req = headers(&mut conn); let user_agent = if cfg!(windows) { - "User-Agent: git/1.0 (libgit2 0.25.0)" + "User-Agent: git/1.0 (libgit2 0.26.0)" } else { - "User-Agent: git/2.0 (libgit2 0.25.0)" + "User-Agent: git/2.0 (libgit2 0.26.0)" }; conn.write_all(b"\ HTTP/1.1 401 Unauthorized\r\n\ diff --git a/tests/concurrent.rs b/tests/concurrent.rs index 37fbd3bb4..2027cb63e 100644 --- a/tests/concurrent.rs +++ b/tests/concurrent.rs @@ -1,4 +1,3 @@ -extern crate cargo; extern crate cargotest; extern crate git2; extern crate hamcrest; diff --git a/tests/cross-compile.rs b/tests/cross-compile.rs index 55ba530a7..3225c6cab 100644 --- a/tests/cross-compile.rs +++ b/tests/cross-compile.rs @@ -529,6 +529,7 @@ fn cross_tests() { name = "bar" "#) .file("src/bin/bar.rs", &format!(r#" + #[allow(unused_extern_crates)] extern crate foo; use std::env; fn main() {{ @@ -698,10 +699,12 @@ fn build_script_needed_for_host_and_target() { "#) .file("build.rs", r#" + #[allow(unused_extern_crates)] extern crate d2; fn main() { d2::d2(); } "#) .file("src/main.rs", " + #[allow(unused_extern_crates)] extern crate d1; fn main() { d1::d1(); } ") @@ -732,6 +735,7 @@ fn build_script_needed_for_host_and_target() { path = "../d1" "#) .file("d2/src/lib.rs", " + #[allow(unused_extern_crates)] extern crate d1; pub fn d2() { d1::d1(); } "); @@ -893,7 +897,11 @@ fn build_script_with_platform_specific_dependencies() { [build-dependencies.d1] path = "d1" "#) - .file("build.rs", "extern crate d1; fn main() {}") + .file("build.rs", " + #[allow(unused_extern_crates)] + extern crate d1; + fn main() {} + ") .file("src/lib.rs", "") .file("d1/Cargo.toml", &format!(r#" [package] @@ -904,7 +912,10 @@ fn build_script_with_platform_specific_dependencies() { [target.{}.dependencies] d2 = {{ path = "../d2" }} "#, host)) - .file("d1/src/lib.rs", "extern crate d2;") + .file("d1/src/lib.rs", " + #[allow(unused_extern_crates)] + extern crate d2; + ") .file("d2/Cargo.toml", r#" [package] name = "d2" -- 2.30.2